<?php	
include "../functions.php";
try{
   $pdo = new Pdo("mysql:host=localhost;dbname=c70","root","admin888");
   //字符集
   $pdo->query("set names utf8");
   //设置错误
   $pdo->setAttribute(PDO::ATTR_ERRMODE,PDO::ERRMODE_EXCEPTION);
   //执行sql
   $sth = $pdo->prepare("select * from stu where age>? and sex=?");
   //参数绑定
   $age = 10;
   $sex = "女";
   $sth->bindParam(1,$age,PDO::PARAM_INT);
   $sth->bindParam(2,$sex,PDO::PARAM_STR);
   //执行
   $sth->execute();
   //接受结果集
   $rows = $sth->fetchAll(PDO::FETCH_ASSOC);
   p($rows);
}catch(PDOException $e){
    echo $e->getMessage();exit;
}